
//
//  XJOrderDescribeCell.h
//  XinJiangMall
//
//  Created by RaoBo on 2018/5/28.
//  Copyright © 2018年 Tzyang. All rights reserved.
//  我的订单文字描述cell
/**
 买家留言:jfkdjfdfd
 配送方式:0000
 */
/**
 订单号:989r898989
 订单创建时间:000909090
 */

#import "XJOrderDescribeCell.h"
@interface XJOrderDescribeCell()
@property(nonatomic, strong) UILabel *aboveLabel; //eg:买家留言:jfkdjfdfd
@property(nonatomic, strong) UILabel *belowLabel; //eg:  配送方式:0000

@end

@implementation XJOrderDescribeCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

#pragma mark - 初始化
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
   self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    
    if (self) {
        [self setupView];
    }
    return self;
}

- (void)setupView{
    [self.contentView addSubview:self.aboveLabel];
    [self.contentView addSubview:self.belowLabel];
}
#pragma mark - lazy
- (UILabel *)aboveLabel {
    if (!_aboveLabel) {
        _aboveLabel = [[UILabel alloc] init];
    }
    return _aboveLabel;
}

- (UILabel *)belowLabel {
    if (!_belowLabel) {
        _belowLabel = [[UILabel alloc] init];
    }
    return _belowLabel;
}


#pragma mark - layout
- (void)layoutSubviews {
    [super layoutSubviews];
    
    CGFloat kMargin = 15;
    
    [self.aboveLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.contentView.mas_left).offset(kMargin);
        make.top.equalTo(self.contentView.mas_top).offset(5);
        make.right.equalTo(self.contentView.mas_right);
    }];
    
    [self.belowLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.aboveLabel.mas_left);
        make.top.equalTo(self.aboveLabel.mas_bottom).offset(5);
        make.bottom.equalTo(self.contentView.mas_bottom).offset(-5);
        make.right.equalTo(self.contentView.mas_right);
    }];
}


- (void)configureXJOrderDescribeCellWithtAboveTitle:(NSString *)title1 belowTitle:(NSString *)belowTitle {
    self.aboveLabel.text = title1;
    self.belowLabel.text =belowTitle;
}

@end
